package two_day;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 判断某数是否是完全数
 */
public class Solution {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数：");
        int n = scanner.nextInt();
        int m = 1;
        for (int i = 1; i < n / 2 + 1; i++) {
            if (n % i == 0) {
                m *= i;
            }
        }
        if (m == n) {
            System.out.println(n + "是完全数");
            return;
        }
        System.out.println(n + "不是完全数");
    }
}
